﻿<%@ page language="java" import="java.util.*, java.text.*,com.zjut.zs.util.tools.*,com.zjut.an.util.tools.*,com.zjut.an.util.system.*,
com.zjut.zs.user.manager.*, com.zjut.zs.user.dao.*,com.zjut.zs.cj.manager.*, com.zjut.zs.cj.dao.*, com.zjut.an.config.manager.*, com.zjut.an.config.dao.*,
com.zjut.an.adplace.manager.*, com.zjut.an.ad.manager.*,com.zjut.an.adplace.dao.*, com.zjut.an.ad.dao.*" pageEncoding="utf-8"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" src="../plugins/assets/plugins/jquery-3.5.1.min.js"></script>
<script type="text/javascript">
$(function(){	
	//顶部导航切换
	$(".nav li a").click(function(){
		$(".nav li a.selected").removeClass("selected")
		$(this).addClass("selected");
	})	
})	
</script>


</head>
<%

//session.setMaxInactiveInterval(60);//60秒
ZsUserManager umanager = (ZsUserManager) SpringContextUtil.getBean("ZsUserManager");
AnConfigManager cmanager = (AnConfigManager) SpringContextUtil.getBean("AnConfigManager");
AnConfig obj = cmanager.getConfigInfoByName("系统banner地址");
String url="images/logo.png";
if (obj!=null) {
	url=obj.getCoValue();
}
 %>
 
<body style="background:url(images/topbg.gif) repeat-x;">

    <div class="topleft">
    <a href="main.jsp" target="_parent"><img src="<%=url %>" title="系统首页" /></a>
    </div>       
    <div class="topright">    
    <ul>
    <li><span><img src="images/help.png" title="帮助"  class="helpimg"/></span><a href="about.jsp" target="rightFrame">关于</a></li>
    <li><a href="zs_logout.jsp" target="_parent">退出</a></li>
    </ul>
     
    <div class="user">
    <span>
<%
if(session.getAttribute("zsUser")!=null) {
	ZsUser user = (ZsUser)session.getAttribute("zsUser");
	out.print("欢迎您　"+user.getUsName());	
}
 %>
	</span>
    </div>    
    </div>
    
    
<script>
//实时判断会话是否超时

var sessionTime=<%=session.getMaxInactiveInterval()%>;
var lastSessionTime,sessionTimeout;
if(sessionTime != ""){
    lastSessionTime = new Date().getTime();
    document.onmousemove = document.onkeypress = document.onkeydown = function(){ 
       lastSessionTime = new Date().getTime();
    }
    if (parseInt(sessionTime,10) != 0){  //任何时候都不自动退出系统
        sessionTimeout = parseInt(sessionTime)*1000;//自动退出时间间隔         
        clearInterval(_TIMER);
       var _TIMER= setInterval(function(){//每10秒钟检查一次。 
           if(sessionTimeout==0){
               return false;
           }
            var now = new Date().getTime(); 
               //如果超时了
            console.info(now - lastSessionTime);
            console.info(sessionTimeout);
            if( (now - lastSessionTime) > sessionTimeout ){ 
               //会话失效,系统将返回登录页面
               window.top.location = "main.jsp";
            } 
        }, 10000); 
    }
}
</script>


</body>
</html>
